Using Text Dictionary Tags in .A5W Pages

Description

When you create a standard .a5w page, you might want to use text dictionary tags in your pages. This can easily be done if you make a change to how your .a5w page is constructed.

The comments here do not apply to using Text Dictionary tags in components. In components, you do not have to do anything special to use text dictionary tags.

The Alpha Anywhere Application Server will not process text dictionary tags. Therefore, you must invoke the special Xbasic function that resolves language tags yourself. The Xbasic function that resolves language tags is:

c resolvedText = A5GridHelper_textDictionaryResolver(c textToResolve, c language)

You therefore need to construct your page so that the entire page is just a string that is then emitted.

Here is an example of how an .a5w page can be changed so that it is a string that is emitted:

<%a5
'Define the page as an Xbasic string variable.
dim html as c 
html = <<%html%
Define your entire html page here as an Xbasic string.
%html%

'Resolve Text Dictionary tags in the string.
html = a5GridHelper_textDictionaryResolver (html,"french")

'Emit the string to the browser
?html
%>

For example:

<%a5
dim html as c
html = <<%html%
<!DOCTYPE html>
<html>
    <head>
        <meta HTTP-EQUIV="MSThemeCompatible" content="Yes" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body>
        <p>This is the body of my page.</p>
        <p>I am going to use a text dictionary tag now.</p>
        <p><a5:t>string1</a5:t></p>
    </body>
</html>
%html%
 

html = a5GridHelper_textDictionaryResolver (html,"french")
?html

%>